package com.vne.skyemart.dao;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.Criterion;

public interface GenericDAO<T, ID extends Serializable> {

	public List<T> findAll();
	public T findById(ID id);
	public List<T> findByProperty(String propertyName, Object value);
	public List<T> findByCriteria(Criterion... criterion );
	public T findObjectByCriteria(Criterion... criterion);
	
    void save(final T entity);
    void saveOrUpdate(final T entity);
    void merge(final T entity);
    void persist(final T entity);
	void update(final T entity);
	void delete(final T entity);
	void deleteById(final ID entityId);
	
	boolean flush();
	boolean close();
}
